<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <p id="p" class="one">hello world</p>
    <script>
        // setAttribute 设置
            // getAttribute 获取
            // removeAttribute
        var p=document.getElementById("p");
        p.onclick=function(){
            this.setAttribute("style","display:none");
        }
        console.log(p.getAttribute("class"))
        console.log(p.removeAttribute("class"))
    </script>
</body>
</html>